package com.zmc.third.infrastructure.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zmc.third.infrastructure.bean.query.PaySettingQuery;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zmc.common.utils.PageUtils;
import com.zmc.common.utils.Query;

import com.zmc.third.infrastructure.dao.PaySettingDao;
import com.zmc.third.infrastructure.entity.PaySettingEntity;
import com.zmc.third.infrastructure.service.PaySettingService;


/**
 * @author zmc
 */
@Service("paySettingService")
public class PaySettingServiceImpl extends ServiceImpl<PaySettingDao, PaySettingEntity> implements PaySettingService {

    @Override
    public PageUtils queryPage(PaySettingQuery query) {
        LambdaQueryWrapper<PaySettingEntity> wrapper = new LambdaQueryWrapper<>();
        Page<PaySettingEntity> page = baseMapper.selectPage(new Page<>(query.getPageNum(), query.getPageSize()), wrapper);
        return new PageUtils(page);
    }

    @Override
    public PaySettingEntity getPaySetting() {
        LambdaQueryWrapper<PaySettingEntity> wrapper = new LambdaQueryWrapper<>();
        wrapper.last(" limit 1");
        return getOne(wrapper);
    }

}